package com.mashibing.servicemap.service.impl;

import com.mashibing.servicemap.remote.MapDirectionClient;
import com.mashibing.servicemap.service.DirectionService;
import org.mashibing.dto.ResponseResult;
import org.mashibing.response.DirectionResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author:
 * @create: 2024/4/2 15:41
 * @description:
 */
@Service
public class DirectionServiceImpl implements DirectionService {


    @Autowired
    private MapDirectionClient mapDirectionClient;

    @Override
    public ResponseResult<DirectionResponse> driving(String depLongitude, String depLatitude, String destLongitude, String destLatitude) {
        DirectionResponse direction = mapDirectionClient.direction(depLongitude, depLatitude, destLongitude, destLatitude);
        return ResponseResult.success(direction);
    }
}
